hysop.backend.device.opencl.opencl_array module¶
- class hysop.backend.device.opencl.opencl_array.OpenClArray(handle, backend, **kargs)[source]¶
Bases:
Array
OpenCl memory array wrapper (pyopencl.array.Array).
- Parameters:
handle (pyopencl.array.Array, implementation of this array)
kargs (arguments for base classes.)
- property T¶
Same as self.transpose(), except that self is returned if self.ndim < 2.
- add_event(evt)[source]¶
Add evt to events. If events is too long, this method may implicitly wait for a subset of events and clear them from the list.
- as_symbolic_array(name, **kwds)[source]¶
Return a symbolic array variable that contain a reference to this array.
- as_symbolic_buffer(name, **kwds)[source]¶
Return a symbolic buffer variable that contain a reference to this array.
- astype(dtype, queue=None, order=SAME_ORDER(3), casting='unsafe', subok=True, copy=True)[source]¶
Copy of the array, cast to a specified type.
- property base¶
Base object if memory is from some other object.
- property base_data¶
- property context¶
Get the opencl context associated to this array.
- property data¶
Buffer object pointing to the start of the array’s data
- property default_queue¶
Get the default queue for this array.
- property device¶
Get the opencl device associated to this array.
- property dtype¶
numpy.dtype representing the type stored into this buffer.
- events()[source]¶
A list of pyopencl.Event instances that the current content of this array depends on. User code may read, but should never modify this list directly. To update this list, instead use the following methods.
- property flags¶
Information about the memory layout of the array.
- get_strides()[source]¶
Tuple of ints that represents the byte step in each dimension when traversing an array.
- property imag¶
The imaginary part of the array.
- property int_ptr¶
Return the underlying buffer pointer as an int.
- max(axis=None, out=None, queue=None, synchronize=True, **kwds)[source]¶
Return the maximum along a given axis. On the first call, a kernel launcher is built for efficiency.
- min(axis=None, out=None, queue=None, synchronize=True, **kwds)[source]¶
Return the minimum along a given axis. On the first call, a kernel launcher is built for efficiency.
- nanmax(axis=None, out=None, queue=None, synchronize=True, **kwds)[source]¶
Return the maximum along a given axis. On the first call, a kernel launcher is built for efficiency.
- nanmin(axis=None, out=None, queue=None, synchronize=True, **kwds)[source]¶
Return the minimum along a given axis. On the first call, a kernel launcher is built for efficiency.
- property nbytes¶
Number of bytes in the whole buffer.
- property ndim¶
Number of array dimensions.
- property offset¶
Offset of array data in buffer.
- property real¶
The real part of the array.
- reshape(shape, order=C_CONTIGUOUS(0))[source]¶
Returns view of array with the same data. If dtype is different from current dtype, the actual bytes of memory will be reinterpreted.
- set_shape(shape)[source]¶
Set the shape of this buffer. From the numpy doc: It is not always possible to change the shape of an array without copying the data. If you want an error to be raised if the data is copied, you should assign the new shape to the shape attribute of the array.
- property shape¶
The real shape of this buffer.
- property size¶
Number of elements in the array.
- property strides¶
Tuple of ints that represents the byte step in each dimension when traversing an array.
- sum(axis=None, out=None, queue=None, synchronize=True, **kwds)[source]¶
Return the sum along a given axis. On the first call, a kernel launcher is built for efficiency.